/**
 *
 */
package org.qianye.soft;

import javax.swing.*;
import java.awt.*;

/**
 * @author Administrator
 */
class SplashWindow extends JWindow {

	private JProgressBar progressBar;

	/**
	 * Create the application.
	 */
	public SplashWindow() {
		init();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void init() {
		JLabel panel = new JLabel();
		panel.setIcon(new ImageIcon(SplashWindow.class.getResource("images/image002.jpg")));

		progressBar = new JProgressBar();
		progressBar.setStringPainted(true);
		progressBar.setIndeterminate(true);
		progressBar.setString("正在加载……");
		progressBar.setValue(0);

		Container contentPane = getContentPane();
		contentPane.add(panel, BorderLayout.CENTER);
		contentPane.add(progressBar, BorderLayout.SOUTH);

		int width = 376, height = 159;
		setSize(width, height);
		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		setLocation((screenSize.width - width) / 2, (screenSize.height - height) / 2);
		this.setAlwaysOnTop(true);
	}

	/**
	 * @param text
	 */
	public void setProText(String text) {
		progressBar.setString(text);
	}

	/**
	 * @param value
	 */
	public void setProValue(int value) {
		progressBar.setValue(value);
	}
}
